<template>
  <div>
    <h1>App</h1>
    <!-- 自定义事件主要是父组件用来接收子组件的传参 -->
    <List ref="listCom"/>
    <p>{{list}}</p>
  </div> 
</template>

<script>
import List from './components/List'
export default {
  name: "App",
  components:{
    List
  },
  mounted(){
      this.$refs.listCom.$on("atguigu",this.getListData)
  },
  data(){
    return {
      list:[]
    }
  },
  methods:{
    getListData(list){
        this.list = [...list]
    }
  }
  
};
</script>

<style>
</style>